const ConfigBaseURL = 'http://localhost:3000'
export const request = function(data) {
	console.log(data);
	return new Promise((resolve, reject) => {
		uni.request({
			method: data.method ?data.method.toUpperCase() : 'GET',
			url: ConfigBaseURL + data.url,
			data: data.params,
			header: {
				// token: uni.getStorageSync('UserData').token
			},
			success: (res) => {
				resolve(res.data)
			},
			fail: (err) => {
				
				reject(err)
			},
			complete: () => {
				uni.hideLoading()
			}
		})
	})
}
